Repository navigation
Fail scan comparisons with missing or invalid package lists - #461
Merged
Merged
Conversation
When the diff-scan poll returned a finished comparison whose artifacts were null and whose incomplete flag was unset, get_diff_scan_artifacts raised a plain Exception. get_added_and_removed_packages treated that like any other failure of the diff-scans flow and fell back to the streaming comparison, whose response has no incomplete flag. The run then reported on a comparison nobody had checked for completeness. A finished comparison without an artifacts object now raises IncompleteComparisonError, which skips the fallback and maps to the infrastructure exit code (3, --exit-code-on-api-error, or 0 under --disable-blocking). Failures of the flow itself (missing token scopes, transient errors, the polling timeout, a truncated response) still fall back to streaming as before.
David Larsen (dc-larsen)
temporarily deployed
to
socket-firewall
November 20, 2026 20:17 — with
GitHub Actions
Inactive
3 when a scan comparison returns no artifacts
The SDK's diffscans.get returns {} for statuses it doesn't raise on (204, an
unfollowed 3xx). That response says nothing about the comparison, so it falls
back to streaming as it did in 2.13.0 instead of exiting 3 with a message
claiming the API finished the comparison. Only a returned diff_scan whose
artifacts are null, missing or not an object raises the incomplete-comparison
error, and its message now says that.
This was referenced Nov 20, 2026
David Larsen (dc-larsen)
temporarily deployed
to
socket-firewall
November 20, 2026 22:18 — with
GitHub Actions
Inactive
…ts-exit-3 # Conflicts: # CHANGELOG.md
This was referenced Nov 20, 2026
…ts-exit-3 # Conflicts: # CHANGELOG.md
2.13.2 was released from main, so this change needs the next patch version.
David Larsen (dc-larsen)
temporarily deployed
to
socket-firewall
November 20, 2026 23:11 — with
GitHub Actions
Inactive
Fail incomplete comparisons before reporting findings. Keep the streaming fallback when the response has no comparison object. Group the pending CLI changes under 2.14.0.
3 when a scan comparison returns no artifacts
lelia
marked this pull request as ready for review
November 24, 2026 02:55
Contributor
|
bugbot run |
PR SummaryOverview Reviewed by Cursor Bugbot for commit 02d777c. Configure here. |
lelia
temporarily deployed
to
socket-firewall
November 24, 2026 02:55 — with
GitHub Actions
Inactive
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 02d777c. Configure here.
lelia
approved these changes
Nov 24, 2026
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Behavior
A diff-scans response with a comparison object must include the five package lists. Missing or invalid lists report an infrastructure failure in standard and strict modes. The CLI accepts
unchanged: nullwhen it requestedomit_unchanged. A response without a comparison object, such as HTTP 204, can still use the streaming fallback.The default exit code is
3.--exit-code-on-api-errorcan remap it, and--disable-blockingtakes precedence.Verification
Release
Ships in 2.14.0. Merge order: #461 → #462 → #460 → #464 → #465 → #463. Merged together in that order on
mainat #459, the six pass the full test suite andruff check.mainrequires branches to be up to date, so update each PR frommainafter the previous merge.CHANGELOG.mdwill conflict each time: combine the bullets under the existing## 2.14.0subsections (Upgrade notes, Changed, Fixed, Documentation) by hand rather than taking either side.This is 1 of 6. Merge it first: it changes the comparison path the other five run through, and #462's test fixture already expects its validation.
Review focus. The CLI validates completed diff-scans results in standard and strict mode. If the API returns a valid package-list shape that the CLI rejects, affected jobs fail before findings with exit
3by default. Before tagging 2.14.0, verify live cached comparisons withomit_unchangedenabled and with unchanged artifacts included.Public Changelog
Comparisons with missing or invalid package lists fail with exit 3 by default. The existing infrastructure-error exit flags apply.
Refs: CE-499